Implemented project structure
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
This is a sample doctest in a text file.
|
||||
|
||||
In this example, we'll rely on a global variable being set for us
|
||||
already:
|
||||
|
||||
>>> favorite_color
|
||||
'blue'
|
||||
|
||||
We can make this fail by disabling the blank-line feature.
|
||||
|
||||
>>> if 1:
|
||||
... print('a')
|
||||
... print()
|
||||
... print('b')
|
||||
a
|
||||
<BLANKLINE>
|
||||
b
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
This is a sample doctest in a text file.
|
||||
|
||||
In this example, we'll rely on some silly setup:
|
||||
|
||||
>>> import test.test_doctest.test_doctest
|
||||
>>> test.test_doctest.test_doctest.sillySetup
|
||||
True
|
||||
|
||||
This test also has some (random) encoded (utf-8) unicode text:
|
||||
|
||||
ÐÐÐÐÐ
|
||||
|
||||
This doesn't cause a problem in the tect surrounding the examples, but
|
||||
we include it here (in this test text file) to make sure. :)
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
Here we check that `__file__` is provided:
|
||||
|
||||
>>> type(__file__)
|
||||
<class 'str'>
|
||||
@@ -0,0 +1,11 @@
|
||||
This is a sample doctest in a text file that contains non-ASCII characters.
|
||||
This file is encoded using UTF-8.
|
||||
|
||||
In order to get this test to pass, we have to manually specify the
|
||||
encoding.
|
||||
|
||||
>>> 'föö'
|
||||
'f\xf6\xf6'
|
||||
|
||||
>>> 'bąr'
|
||||
'b\u0105r'
|
||||
@@ -0,0 +1,14 @@
|
||||
This is a sample doctest in a text file, in which all examples fail
|
||||
or raise an exception.
|
||||
|
||||
>>> 2 + 2
|
||||
5
|
||||
>>> 1/0
|
||||
1
|
||||
>>> def f():
|
||||
... 2 + '2'
|
||||
...
|
||||
>>> f()
|
||||
1
|
||||
>>> 2+*3
|
||||
5
|
||||
@@ -0,0 +1,6 @@
|
||||
This is a sample doctest in a text file, in which all examples are skipped.
|
||||
|
||||
>>> 2 + 2 # doctest: +SKIP
|
||||
5
|
||||
>>> 2 + 2 # doctest: +SKIP
|
||||
4
|
||||
@@ -0,0 +1,6 @@
|
||||
This is a sample doctest in a text file, in which some examples are skipped.
|
||||
|
||||
>>> 2 + 2 # doctest: +SKIP
|
||||
5
|
||||
>>> 2 + 2
|
||||
4
|
||||
Reference in New Issue
Block a user