gnu: Enable python-parse-type tests.
Fixes <http://bugs.gnu.org/26900>. * gnu/packages/python.scm (python-parse-type)[arguments]: Enable tests. Add phase "patch-tests". [native-inputs]: Add python-pytest, python-pytest-runner. [properties]: Add python2-variant. (python2-parse-type): New variable.master
parent
77c729baf2
commit
8ed1288938
|
@ -1487,16 +1487,38 @@ backported for previous versions of Python from 2.4 to 3.3.")
|
||||||
(base32
|
(base32
|
||||||
"0iv1c34npr4iynwpgv1vkjx9rjd18a85ir8c01gc5f7wp8iv7l1x"))))
|
"0iv1c34npr4iynwpgv1vkjx9rjd18a85ir8c01gc5f7wp8iv7l1x"))))
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:phases
|
||||||
|
(modify-phases %standard-phases
|
||||||
|
(add-after 'unpack 'patch-tests
|
||||||
|
(lambda _
|
||||||
|
(substitute* "tests/test_parse_type_parse.py"
|
||||||
|
;; Newer Python versions don't have the problem this test tests.
|
||||||
|
(("self[.]assertRaises[(]parse.TooManyFields, p.parse, ''[)]")
|
||||||
|
""))
|
||||||
|
#t)))))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
`(("python-six" ,python-six)
|
`(("python-six" ,python-six)
|
||||||
("python-parse" ,python-parse)))
|
("python-parse" ,python-parse)))
|
||||||
(arguments '(#:tests? #f)) ;TODO: tests require pytest
|
(native-inputs
|
||||||
|
`(("python-pytest" ,python-pytest)
|
||||||
|
("python-pytest-runner" ,python-pytest-runner)))
|
||||||
(home-page "https://github.com/jenisys/parse_type")
|
(home-page "https://github.com/jenisys/parse_type")
|
||||||
(synopsis "Extended parse module")
|
(synopsis "Extended parse module")
|
||||||
(description
|
(description
|
||||||
"Parse_type extends the python parse module.")
|
"Parse_type extends the python parse module.")
|
||||||
|
(properties
|
||||||
|
`((python2-variant . ,(delay python2-parse-type))))
|
||||||
(license license:bsd-3)))
|
(license license:bsd-3)))
|
||||||
|
|
||||||
|
(define-public python2-parse-type
|
||||||
|
(let ((base (package-with-python2
|
||||||
|
(strip-python2-variant python-parse-type))))
|
||||||
|
(package (inherit base)
|
||||||
|
(propagated-inputs
|
||||||
|
`(("python2-enum34" ,python2-enum34)
|
||||||
|
,@(package-propagated-inputs base))))))
|
||||||
|
|
||||||
(define-public python-parse
|
(define-public python-parse
|
||||||
(package
|
(package
|
||||||
(name "python-parse")
|
(name "python-parse")
|
||||||
|
|
Reference in New Issue