1{ stdenv, buildPythonPackage, fetchFromGitHub, python, pytest, glibcLocales }: 2 3buildPythonPackage rec { 4 version = "3.4.1"; 5 pname = "pyfakefs"; 6 7 # no tests in PyPI tarball 8 # https://github.com/jmcgeheeiv/pyfakefs/pull/361 9 src = fetchFromGitHub { 10 owner = "jmcgeheeiv"; 11 repo = pname; 12 rev = "v${version}"; 13 sha256 = "0i8kq7sl8bczr927hllgfhsmirjqjh89c9184kcqmprc13ac4kxy"; 14 }; 15 16 postPatch = '' 17 # test doesn't work in sandbox 18 substituteInPlace tests/fake_filesystem_test.py \ 19 --replace "test_expand_root" "notest_expand_root" 20 substituteInPlace tests/fake_os_test.py \ 21 --replace "test_append_mode" "notest_append_mode" 22 ''; 23 24 checkInputs = [ pytest glibcLocales ]; 25 26 checkPhase = '' 27 LC_ALL=en_US.UTF-8 ${python.interpreter} -m tests.all_tests 28 py.test tests/pytest_plugin_test.py 29 ''; 30 31 meta = with stdenv.lib; { 32 description = "Fake file system that mocks the Python file system modules"; 33 license = licenses.asl20; 34 homepage = http://pyfakefs.org/; 35 maintainers = with maintainers; [ gebner ]; 36 }; 37}