nixpkgs/pkgs/development/python-modules/bottle/default.nix
Sandro Jäckel b345e08f5d
python310Packages.bottle: disable timing sensitive test
____________________________ TestSendFile.test_ims _____________________________

self = <test.test_sendfile.TestSendFile testMethod=test_ims>

    def test_ims(self):
        """ SendFile: If-Modified-Since"""
        request.environ['HTTP_IF_MODIFIED_SINCE'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime())
        res = static_file(basename, root=root)
        self.assertEqual(304, res.status_code)
        self.assertEqual(int(os.stat(__file__).st_mtime), parse_date(res.headers['Last-Modified']))
>       self.assertAlmostEqual(int(time.time()), parse_date(res.headers['Date']))
E       AssertionError: 1680561734 != 1680561733.0 within 7 places (1.0 difference)

test_sendfile.py:78: AssertionError
2023-04-08 17:38:38 +02:00

43 lines
770 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "bottle";
version = "0.12.24";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-JIASGnPoc4CYm3fjK9IJLRkOfqfXHm8bj3r36rnVTqM=";
};
nativeCheckInputs = [
pytestCheckHook
];
preCheck = ''
cd test
'';
disabledTests = [
"test_delete_cookie"
"test_error"
"test_error_in_generator_callback"
# timing sensitive
"test_ims"
];
__darwinAllowLocalNetworking = true;
meta = with lib; {
homepage = "https://bottlepy.org/";
description = "A fast and simple micro-framework for small web-applications";
license = licenses.mit;
maintainers = with maintainers; [ koral ];
};
}