File tree 3 files changed +41
-0
lines changed
3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+
3
+ def hello (txt ):
4
+ print ("Hello, %s!" % txt )
5
+
6
+
7
+ def elevation ():
8
+ """Returns elevation of Nevado Sajama."""
9
+ return 21463
Original file line number Diff line number Diff line change
1
+ import sys
2
+
3
+ from skbuild import setup
4
+
5
+ # Require pytest-runner only when running tests
6
+ pytest_runner = (['pytest-runner>=2.0,<3dev' ]
7
+ if any (arg in sys .argv for arg in ('pytest' , 'test' ))
8
+ else [])
9
+
10
+ setup_requires = pytest_runner
11
+
12
+ setup (
13
+ name = "hello-pure" ,
14
+ version = "1.2.3" ,
15
+ description = "a minimal example package (pure python version)" ,
16
+ author = 'The scikit-build team' ,
17
+ license = "MIT" ,
18
+ packages = ['hello' ],
19
+ tests_require = ['pytest' ],
20
+ setup_requires = setup_requires
21
+ )
Original file line number Diff line number Diff line change
1
+ import hello
2
+
3
+
4
+ def test_hello (capfd ):
5
+ hello .hello ("World" )
6
+ captured = capfd .readouterr ()
7
+ assert captured .out == "Hello, World!"
8
+
9
+
10
+ def test_elevation ():
11
+ assert hello .elevation () == 21463
You can’t perform that action at this time.
0 commit comments