Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_text fails #37

Closed
grozin opened this issue May 25, 2022 · 0 comments
Closed

test_text fails #37

grozin opened this issue May 25, 2022 · 0 comments

Comments

@grozin
Copy link

grozin commented May 25, 2022

grozin@bilbo ~/tmp/pyx-master/test/functional $ python test_text.py 
ignoring special 'Warning: missing glyph `Gamma''
ignoring special 'Warning: missing glyph `Gamma''
ignoring special 'Warning: missing glyph `Gamma''
ignoring special 'Warning: missing glyph `Gamma''
Traceback (most recent call last):
  File "/home/grozin/tmp/pyx-master/test/functional/test_text.py", line 117, in <module>
    ue_pfm = text.UnicodeEngine(metric=text.UnicodeEngine.pfm_metric)
AttributeError: type object 'UnicodeEngine' has no attribute 'pfm_metric'

Indeed, class UnicodeEngine in pyx/text.py has only the attributes

>>> dir(pyx.text.UnicodeEngine)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'preamble', 'reset', 'text', 'text_pt']

I had to comment out 2 lines in test/functional/test_text.py:

ue_pfm = text.UnicodeEngine(metric=text.UnicodeEngine.pfm_metric)
c.insert(ue_pfm.text(10, 8, "UnicodeEngine output (PFM)"))

then tests run successfully.

Using this occasion, I'd like to add 2 points:

  1. In pyx/text.py,
r = self._wait(self._received.wait, self._received.isSet)

isSet is deprecated, and should be replaced by is_set.

  1. In manual/colorname.py and manual/gradientname.py,
lines = imp.find_module("color", pyx.__path__)[0].readlines()

imp is deprecated, and importlib should be used instead. However, there is no exact equivalent of imp.find_module, and some thought is needed. I have not done it.

m-schindler added a commit to m-schindler/pyx that referenced this issue Oct 5, 2022
m-schindler added a commit to m-schindler/pyx that referenced this issue Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant