Skip to content

Commit

Permalink
devel/py-pyfakefs: Add py-pyfakefs 5.3.5
Browse files Browse the repository at this point in the history
pyfakefs implements a fake file system that mocks the Python file system
modules. Using pyfakefs, your tests operate on a fake file system in memory
without touching the real disk. The software under test requires no modification
to work with pyfakefs.

Pyfakefs creates a new empty in-memory file system at each test start, which
replaces the real filesystem during the test. Think of pyfakefs as making a
per-test temporary directory, except for an entire file system.

There are several means to achieve this: by using the fs fixture if running
pytest, by using fake_filesystem_unittest.TestCase as a base class if using
unittest, by using a fake_filesystem_unittest.Patcher instance as a context
manager, or by using the patchfs decorator.
  • Loading branch information
sunpoet committed Mar 31, 2024
1 parent 11c8860 commit 9815657
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions devel/Makefile
Expand Up @@ -5350,6 +5350,7 @@
SUBDIR += py-pyee
SUBDIR += py-pyelftools
SUBDIR += py-pyface
SUBDIR += py-pyfakefs
SUBDIR += py-pyfcm
SUBDIR += py-pyflakes
SUBDIR += py-pyformance
Expand Down
24 changes: 24 additions & 0 deletions devel/py-pyfakefs/Makefile
@@ -0,0 +1,24 @@
PORTNAME= pyfakefs
PORTVERSION= 5.3.5
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Implement a fake file system that mocks the Python file system modules
WWW= https://pytest-pyfakefs.readthedocs.io/en/stable/ \
https://github.com/jmcgeheeiv/pyfakefs

LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/COPYING

BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}undefined>=0:devel/py-undefined@${PY_FLAVOR}

USES= python
USE_PYTHON= autoplist concurrent pep517 pytest

NO_ARCH= yes

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions devel/py-pyfakefs/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1710603292
SHA256 (pyfakefs-5.3.5.tar.gz) = 7cdc500b35a214cb7a614e1940543acc6650e69a94ac76e30f33c9373bd9cf90
SIZE (pyfakefs-5.3.5.tar.gz) = 196773
13 changes: 13 additions & 0 deletions devel/py-pyfakefs/pkg-descr
@@ -0,0 +1,13 @@
pyfakefs implements a fake file system that mocks the Python file system
modules. Using pyfakefs, your tests operate on a fake file system in memory
without touching the real disk. The software under test requires no modification
to work with pyfakefs.

Pyfakefs creates a new empty in-memory file system at each test start, which
replaces the real filesystem during the test. Think of pyfakefs as making a
per-test temporary directory, except for an entire file system.

There are several means to achieve this: by using the fs fixture if running
pytest, by using fake_filesystem_unittest.TestCase as a base class if using
unittest, by using a fake_filesystem_unittest.Patcher instance as a context
manager, or by using the patchfs decorator.

0 comments on commit 9815657

Please sign in to comment.