Skip to content

Commit 089da72

Browse files
committed
Do not test extra dependencies with Python 3.10
- some dependencies are not available for the beta version - comment out docker tests - setup currently fails, has to be handled separately
1 parent 41de619 commit 089da72

File tree

2 files changed

+45
-19
lines changed

2 files changed

+45
-19
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,33 +79,44 @@ jobs:
7979
shell: bash
8080
- name: Install extra dependencies
8181
run: |
82-
pip install -r extra_requirements.txt
82+
# some extra dependencies are not avaialble in 3.10 Beta yet
83+
# so we exclude it from all tests on extra dependencies
84+
if [[ '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
85+
pip install -r extra_requirements.txt
86+
fi
87+
shell: bash
8388
- name: Run unit tests with extra packages as non-root user
8489
run: |
85-
python -m pyfakefs.tests.all_tests
90+
if [[ '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
91+
python -m pyfakefs.tests.all_tests
92+
fi
93+
shell: bash
8694
- name: Run pytest tests
8795
run: |
88-
export PY_VERSION=${{ matrix.python-version }}
89-
$GITHUB_WORKSPACE/.github/workflows/run_pytest.sh
96+
if [[ '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
97+
export PY_VERSION=${{ matrix.python-version }}
98+
$GITHUB_WORKSPACE/.github/workflows/run_pytest.sh
99+
fi
90100
shell: bash
91101
- name: Run performance tests
92102
run: |
93-
if [[ '${{ matrix.os }}' != 'macOS-latest' ]]; then
103+
if [[ '${{ matrix.os }}' != 'macOS-latest' && '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
94104
export TEST_PERFORMANCE=1
95105
python -m pyfakefs.tests.performance_test
96106
fi
97107
shell: bash
98108

99-
dockertests:
100-
runs-on: ubuntu-latest
101-
strategy:
102-
fail-fast: false
103-
matrix:
104-
docker-image: [centos, debian, fedora, ubuntu]
105-
steps:
106-
- uses: actions/checkout@v2
107-
- name: Setup docker container
108-
run: |
109-
docker build -t pyfakefs -f $GITHUB_WORKSPACE/.github/workflows/dockerfiles/Dockerfile_${{ matrix.docker-image }} . --build-arg github_repo=$GITHUB_REPOSITORY --build-arg github_branch=$(basename $GITHUB_REF)
110-
- name: Run tests
111-
run: docker run -t pyfakefs
109+
# setting up up docker containers currently fails
110+
# dockertests:
111+
# runs-on: ubuntu-latest
112+
# strategy:
113+
# fail-fast: false
114+
# matrix:
115+
# docker-image: [centos, debian, fedora, ubuntu]
116+
# steps:
117+
# - uses: actions/checkout@v2
118+
# - name: Setup docker container
119+
# run: |
120+
# docker build -t pyfakefs -f $GITHUB_WORKSPACE/.github/workflows/dockerfiles/Dockerfile_${{ matrix.docker-image }} . --build-arg github_repo=$GITHUB_REPOSITORY --build-arg github_branch=$(basename $GITHUB_REF)
121+
# - name: Run tests
122+
# run: docker run -t pyfakefs

pyfakefs/tests/fake_pathlib_test.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,22 @@ def test_symlink(self):
970970
def test_stat(self):
971971
path = self.make_path('foo', 'bar', 'baz')
972972
self.create_file(path, contents='1234567')
973-
self.assertEqual(self.os.stat(path), self.os.stat(self.path(path)))
973+
self.assertEqual(self.os.stat(path), self.path(path).stat())
974+
975+
@unittest.skipIf(sys.version_info < (3, 10), "New in Python 3.10")
976+
def test_stat_follow_symlinks(self):
977+
self.check_posix_only()
978+
directory = self.make_path('foo')
979+
base_name = 'bar'
980+
file_path = self.path(self.os.path.join(directory, base_name))
981+
link_path = self.path(self.os.path.join(directory, 'link'))
982+
contents = "contents"
983+
self.create_file(file_path, contents=contents)
984+
self.create_symlink(link_path, base_name)
985+
self.assertEqual(len(contents),
986+
link_path.stat(follow_symlinks=True)[stat.ST_SIZE])
987+
self.assertEqual(len(base_name),
988+
link_path.stat(follow_symlinks=False)[stat.ST_SIZE])
974989

975990
def test_utime(self):
976991
path = self.make_path('some_file')

0 commit comments

Comments
 (0)