Skip to content

Replace session-scoped with module-scoped fixture in test #1152

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

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/dockerfiles/Dockerfile_debian
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ WORKDIR work/pyfakefs
RUN python3 -m venv ../venv
RUN ../venv/bin/pip install -r requirements.txt
RUN ../venv/bin/pip install -r extra_requirements.txt
RUN ../venv/bin/pip install parquet pyarrow
RUN ../venv/bin/pip install -e .

USER pyfakefs
ENV PYTHONPATH work/pyfakefs
ENV TEST_REAL_FS=1
CMD ["../venv/bin/python", "-m", "pyfakefs.tests.all_tests"]
CMD ["../venv/bin/pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]
3 changes: 2 additions & 1 deletion .github/workflows/dockerfiles/Dockerfile_fedora
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ RUN chown -R pyfakefs:pyfakefs work/pyfakefs
WORKDIR work/pyfakefs
RUN pip3 install -r requirements.txt
RUN pip3 install -r extra_requirements.txt
RUN pip3 install -e .

USER pyfakefs
ENV PYTHONPATH work/pyfakefs
ENV TEST_REAL_FS=1
CMD ["python3", "-m", "pyfakefs.tests.all_tests"]
CMD ["pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]
3 changes: 2 additions & 1 deletion .github/workflows/dockerfiles/Dockerfile_redhat
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ RUN chown -R pyfakefs:pyfakefs work/pyfakefs
WORKDIR work/pyfakefs
RUN pip3 install -r requirements.txt
RUN pip3 install -r extra_requirements.txt
RUN pip3 install -e .

USER pyfakefs
ENV PYTHONPATH work/pyfakefs
ENV TEST_REAL_FS=1
CMD ["python3", "-m", "pyfakefs.tests.all_tests"]
CMD ["pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]
4 changes: 3 additions & 1 deletion .github/workflows/dockerfiles/Dockerfile_ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ WORKDIR work/pyfakefs
RUN python3 -m venv ../venv
RUN ../venv/bin/pip install -r requirements.txt
RUN ../venv/bin/pip install -r extra_requirements.txt
RUN ../venv/bin/pip install parquet pyarrow
RUN ../venv/bin/pip install -e .

USER pyfakefs
ENV PYTHONPATH work/pyfakefs
ENV TEST_REAL_FS=1
CMD ["../venv/bin/python", "-m", "pyfakefs.tests.all_tests"]
CMD ["../venv/bin/pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]
1 change: 0 additions & 1 deletion .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ jobs:
run: |
echo "$(python -m pytest pyfakefs/pytest_tests/pytest_plugin_failing_helper.py)" > ./testresult.txt
pytest pyfakefs/pytest_tests
pytest pyfakefs/pytest_session_tests
cd pyfakefs/pytest_tests/ns_package
pytest --log-cli-level=INFO test
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The released versions correspond to PyPI releases.

### Infrastructure
* adapt test for increased default buffer size in Python 3.14a6
* replace session-scoped with module-scoped fixture in test,
run pytest over all tests in docker containers
(see [#1151](../../issues/1151))

## [Version 5.8.0](https://pypi.python.org/pypi/pyfakefs/5.8.0) (2025-03-11)
Adds preliminary support for Python 3.14.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def test_handler_and_check_in_fixture(handler_and_check):
assert Path("/foo/bar").exists()


@pytest.fixture(scope="session", autouse=True)
def config(fs_session: FakeFilesystem):
fs_session.create_file("/foo/bar")
@pytest.fixture(scope="module", autouse=True)
def config(fs_module: FakeFilesystem):
fs_module.create_file("/foo/bar")
Loading