| Total Complexity | 5 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # pyre-strict |
||
|
|
|||
| 2 | |||
| 3 | import unittest |
||
| 4 | import os |
||
| 5 | |||
| 6 | |||
| 7 | class PyreStrictTest(unittest.TestCase): |
||
|
1 ignored issue
–
show
|
|||
| 8 | def test_strict_mode_all_python_files(self) -> None: |
||
|
1 ignored issue
–
show
|
|||
| 9 | for directory, _directories, files in os.walk('.'): |
||
|
1 ignored issue
–
show
|
|||
| 10 | for file in files: |
||
|
1 ignored issue
–
show
|
|||
| 11 | if not file.endswith('.py'): |
||
|
1 ignored issue
–
show
|
|||
| 12 | continue |
||
|
1 ignored issue
–
show
|
|||
| 13 | |||
| 14 | path = os.path.join(directory, file) |
||
|
1 ignored issue
–
show
|
|||
| 15 | |||
| 16 | with open(path) as f: |
||
|
1 ignored issue
–
show
|
|||
| 17 | first_line: str = f.readline() |
||
|
1 ignored issue
–
show
|
|||
| 18 | |||
| 19 | self.assertEqual( |
||
|
1 ignored issue
–
show
|
|||
| 20 | first_line, |
||
|
1 ignored issue
–
show
|
|||
| 21 | '# pyre-strict\n', |
||
| 22 | path + ' is not set to Pyre strict mode.', |
||
| 23 | ) |
||
| 24 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.