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

assertRegex #164

Open
benjaminp opened this issue Dec 11, 2016 · 2 comments
Open

assertRegex #164

benjaminp opened this issue Dec 11, 2016 · 2 comments

Comments

@benjaminp
Copy link
Owner

Originally reported by: Arthur Goldberg (Bitbucket: arthurgoldberg, GitHub: Unknown)


Don't have time for good report. In brief:
six.assertRegex()¶
Alias for assertRegex() on Python 3 and assertRegexpMatches() on Python 2.

doesn't work with nosetests-2.7. I get.

ERROR: test_Specie (tests.test_specie.TestSpecie)

Traceback (most recent call last):
File "/Users/arthur_at_sinai/gitOnMyLaptopLocal/wc_sim/tests/test_specie.py", line 40, in test_Specie
six.assertRegex(self, s1.row(), 'specie\t10..\t0..\t0..*')
AttributeError: 'module' object has no attribute 'assertRegex'


@benjaminp
Copy link
Owner Author

Original comment by Matthias Liebig (Bitbucket: mliebig, GitHub: Unknown):


Please execute the following and post the results:

#!python

import six
print(six.__version__)
print(six.__file__)

@humitos
Copy link

humitos commented Jan 26, 2018

I'm having a similar/the same issue:

>>> print(six.__version__)
1.11.0
>>> print(six.__file__)
/home/humitos/.pyenv/versions/3.6.4/envs/rtd3/lib/python3.6/site-packages/six.py
>>> six.assertRegex(r'python', r'python')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/humitos/.pyenv/versions/3.6.4/envs/rtd3/lib/python3.6/site-packages/six.py", line 681, in assertRegex
    return getattr(self, _assertRegex)(*args, **kwargs)
AttributeError: 'str' object has no attribute 'assertRegex'
>>> 

In Python 3.6.4

>>> import unittest
>>> t = unittest.TestCase()
>>> t.assertRegex('python', r'python')
>>>

humitos added a commit to readthedocs/readthedocs.org that referenced this issue Jan 26, 2018
six is broken for this method, see:

benjaminp/six#164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants