Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neutrinoceros/pytest_bug_reprod
A sample Python package to illustrate a regression in pytest
https://github.com/neutrinoceros/pytest_bug_reprod
Last synced: about 6 hours ago
JSON representation
A sample Python package to illustrate a regression in pytest
- Host: GitHub
- URL: https://github.com/neutrinoceros/pytest_bug_reprod
- Owner: neutrinoceros
- Created: 2023-08-03T07:57:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-03T08:12:30.000Z (over 1 year ago)
- Last Synced: 2023-08-03T09:28:44.624Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Reprod
### Install package
```shell
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install . # important : not using editable mode here !
```### test with pytest 7.2
```shell
python -m pip install 'pytest==7.2.0'
pytest
pytest --doctest-modules
```
(everything should be ok)### test with pytest dev
```shell
python -m pip install git+https://github.com/pytest-dev/pytest@4797dea
pytest # should be ok
pytest --doctest-modules # error !
```
```
============================================ test session starts =============================================
platform darwin -- Python 3.11.4, pytest-8.0.0.dev144+g4797deab, pluggy-1.2.0
rootdir: /Users/robcleme/dev/pytest_bug_reprod
collected 1 item / 1 error=================================================== ERRORS ===================================================
______________________________________ ERROR collecting src/pkg/mod.py _______________________________________
.venv/lib/python3.11/site-packages/_pytest/runner.py:340: in from_call
result: Optional[TResult] = func()
.venv/lib/python3.11/site-packages/_pytest/runner.py:371: in
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
.venv/lib/python3.11/site-packages/_pytest/doctest.py:547: in collect
module = import_path(
.venv/lib/python3.11/site-packages/_pytest/pathlib.py:590: in import_path
raise ImportPathMismatchError(module_name, module_file, path)
E _pytest.pathlib.ImportPathMismatchError: ('pkg.mod', '/Users/robcleme/dev/pytest_bug_reprod/.venv/lib/python3.11/site-packages/pkg/mod.py', PosixPath('/Users/robcleme/dev/pytest_bug_reprod/src/pkg/mod.py'))
========================================== short test summary info ===========================================
ERROR src/pkg/mod.py - _pytest.pathlib.ImportPathMismatchError: ('pkg.mod', '/Users/robcleme/dev/pytest_bug_reprod/.venv/lib/pyt...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================== 1 error in 0.13s ==============================================
```