-
Notifications
You must be signed in to change notification settings - Fork 15
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
0.50: pytest based test suite is failing #36
Comments
We are not using https://github.com/rhinstaller/python-meh/blob/master/tests/baseclass.py#L6 |
And you have no intention to put test units under pytest? |
No, we don't. We don't want to introduce another dependency because of tests. I know |
BTW is that error about assertion is it not sometninbg which could be fixed in the python-meh code? |
Have side question: is that module has pypi entry? 🤔 |
Just tested 0.51 and looks like pytest is now failing on missing collected 1 item / 1 error
==================================== ERRORS ====================================
____________________ ERROR collecting examples/meh_test.py _____________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-meh-python-meh-0.51/examples/meh_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
examples/meh_test.py:6: in <module>
import meh.handler
../../BUILDROOT/python-meh-0.51-2.fc35.x86_64/usr/lib/python3.8/site-packages/meh/handler.py:23: in <module>
import report
E ModuleNotFoundError: No module named 'report'
=========================== short test summary info ============================
ERROR examples/meh_test.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.10s =============================== |
With testpaths pointing only to + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-meh-0.51-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-meh-0.51-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' tests
============================= test session starts ==============================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-meh-python-meh-0.51
collected 1 item
tests/safe_string_test.py F [100%]
=================================== FAILURES ===================================
___________________________ SafeStr_TestCase.runTest ___________________________
self = <tests.safe_string_test.SafeStr_TestCase testMethod=runTest>
def runTest(self):
self.safestr += self.asciistr
self.safestr += self.enc_unistr
self.safestr += self.unistr
self.safestr += self.bindata
self.safestr += self.test_object
self.safestr += self.test_object2
self.assertIn(self.asciistr, self.safestr)
if PY == 2:
self.assertIn("OMITTED OBJECT WITHOUT __str__ METHOD", self.safestr)
# should be included twice -- appended enc_unistr and unistr
self.assertIn(str(self.enc_unistr), self.safestr)
else:
> self.assertIn("<safe_string_test.TestClass2 object at ", self.safestr)
E AssertionError: '<safe_string_test.TestClass2 object at ' not found in "aaaab'\\xc3\\xa1\\xc3\\xa1\\xc3\\xa1\\xc3\\xa1\\xc3\\xa1'áááááb'\\xff\\xff\\xfe'string representation of TestClass instance<tests.safe_string_test.TestClass2 object at 0x7fe77ed52100>"
tests/safe_string_test.py:38: AssertionError
=========================== short test summary info ============================
FAILED tests/safe_string_test.py::SafeStr_TestCase::runTest - AssertionError:...
============================== 1 failed in 0.04s =============================== Looks like pytest did not scanned other tests/ fieles baceuse by default it sv=cans only tests_*.py files. After specify + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-meh-0.51-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-meh-0.51-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' tests/__init__.py tests/attrSkipList.py tests/baseclass.py tests/callbacks.py tests/handle_binary.py tests/handle_unicode.py tests/safe_string_test.py
============================= test session starts ==============================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-meh-python-meh-0.51
collected 6 items
tests/attrSkipList.py .. [ 16%]
tests/callbacks.py . [ 33%]
tests/handle_binary.py . [ 50%]
tests/handle_unicode.py . [ 66%]
tests/safe_string_test.py F
=================================== FAILURES ===================================
___________________________ SafeStr_TestCase.runTest ___________________________
self = <tests.safe_string_test.SafeStr_TestCase testMethod=runTest>
def runTest(self):
self.safestr += self.asciistr
self.safestr += self.enc_unistr
self.safestr += self.unistr
self.safestr += self.bindata
self.safestr += self.test_object
self.safestr += self.test_object2
self.assertIn(self.asciistr, self.safestr)
if PY == 2:
self.assertIn("OMITTED OBJECT WITHOUT __str__ METHOD", self.safestr)
# should be included twice -- appended enc_unistr and unistr
self.assertIn(str(self.enc_unistr), self.safestr)
else:
> self.assertIn("<safe_string_test.TestClass2 object at ", self.safestr)
E AssertionError: '<safe_string_test.TestClass2 object at ' not found in "aaaab'\\xc3\\xa1\\xc3\\xa1\\xc3\\xa1\\xc3\\xa1\\xc3\\xa1'áááááb'\\xff\\xff\\xfe'string representation of TestClass instance<tests.safe_string_test.TestClass2 object at 0x7fe31f7b0610>"
tests/safe_string_test.py:38: AssertionError
=========================== short test summary info ============================
FAILED tests/safe_string_test.py::SafeStr_TestCase::runTest - AssertionError:...
========================= 1 failed, 5 passed in 0.13s ========================== soat least some files in tests/ needs to be renamed. |
The text was updated successfully, but these errors were encountered: