Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maximum of test coverage by adding tests for each method
- Loading branch information
Showing
3 changed files
with
139 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from tests import c_exec | ||
|
||
import pytest | ||
|
||
|
||
GLOBAL_EXAMPLE = """ | ||
a = 1 | ||
global a | ||
""" | ||
|
||
|
||
@pytest.mark.parametrize(*c_exec) | ||
def test_Global(c_exec): | ||
result = c_exec(GLOBAL_EXAMPLE) | ||
assert result.code is None | ||
assert result.errors == ( | ||
'Line 3: Global statements are not allowed.', | ||
) | ||
assert result.warnings == [] | ||
assert result.used_names == {} | ||
|
||
|
||
NONLOCAL_EXAMPLE = """ | ||
a = 1 | ||
nonlocal a | ||
""" | ||
|
||
|
||
@pytest.mark.parametrize(*c_exec) | ||
def test_Nonlocal(c_exec): | ||
result = c_exec(NONLOCAL_EXAMPLE) | ||
assert result.code is None | ||
assert result.errors == ( | ||
'Line 3: Nonlocal statements are not allowed.', | ||
) | ||
assert result.warnings == [] | ||
assert result.used_names == {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters