pytest-dev / pytest-dev/unittest2pytest
0.4: pytest warnings
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 141
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
- "setup.py build"
- "setup.py install --root </install/prefix>"
- "pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
May I ask for help because few units are failing:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-unittest2pytest-0.4-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-unittest2pytest-0.4-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=2538216899
rootdir: /home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, anyio-3.3.0, asyncio-0.15.1, trio-0.7.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, Faker-8.12.1, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1, twisted-1.13.3
collected 36 items
tests/test_all_fixes.py .................s.................. [100%]
============================================================================= warnings summary =============================================================================
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNone]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNone_out.py:14: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 'abc' is None
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIs]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIs_out.py:5: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert abc is 'xxx'
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIs]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIs_out.py:8: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 123 is xxx+y
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIs]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIs_out.py:9: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 456 is (aaa and bbb)
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIs]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIs_out.py:10: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 789 is (ccc or ddd)
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIs]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIs_out.py:11: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 123 is (True if You else False)
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIs]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIs_out.py:14: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 'abc' is 'def'
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIs]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIs_out.py:18: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 123 is xxx+z, 'This is wrong!'
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNot]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNot_out.py:5: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert abc is not 'xxx'
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNot]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNot_out.py:8: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert 123 is not xxx+y
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNot]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNot_out.py:9: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert 456 is not (aaa and bbb)
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNot]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNot_out.py:10: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert 789 is not (ccc or ddd)
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNot]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNot_out.py:11: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert 123 is not (True if You else False)
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNot]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNot_out.py:14: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert 'abc' is not 'def'
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNot]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNot_out.py:18: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert 123 is not xxx+z, error_message
tests/test_all_fixes.py::test_check_fixture[self_assert-assertIsNotNone]
/home/tkloczko/rpmbuild/BUILD/unittest2pytest-0.4/tests/fixtures/self_assert/assertIsNotNone_out.py:14: SyntaxWarning: "is not" with a literal. Did you mean "!="?
assert 'def' is not None
-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_all_fixes.py:87: unittest does not have TestCase.assertItemsEqual
================================================================ 35 passed, 1 skipped, 16 warnings in 1.21s ================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/test_all_fixes.py and the warning-producing fixture files under tests/fixtures/self_assert/, especially the assertIs and assertIsNot outputs. Run the reported pytest command and compare those fixtures with the test expectations; the issue does not specify a desired completion criterion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100