-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: ci/cd * fix: fixed the ci/cd * fix: add ruff installation through pip * feat: added test and updated the workflow * feat: updated the install command
- Loading branch information
1 parent
2321d91
commit e35ebb1
Showing
5 changed files
with
119 additions
and
12 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 @@ | ||
from pyfix_imports.pyflake import pyflake | ||
from tests.test import test_code | ||
|
||
def check_code(output): | ||
mod_list = pyflake(output) | ||
|
||
if mod_list: | ||
return mod_list | ||
else: | ||
return {} | ||
|
||
|
||
def test_code_output(): | ||
assert check_code(test_code) == {'defaultdict', 'Tuple', 'List', 'mp', 'Optional', 'time', 'np', 'deque', 'os', 'itertools', 'Dict', 'dedent', 'collections', 'random'} | ||
|
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,32 @@ | ||
test_code = """ | ||
start = time.time() | ||
a = np.array([1, 2, 3, 4]) | ||
b = os.getcwd() | ||
c = random.randint(1, 3) | ||
deq = deque() | ||
a = dedent("121") | ||
d = defaultdict(str) | ||
a = mp.sqrt_mod(12, 2) | ||
itt = itertools.accumulate([1, 2, 3, 4]) | ||
print(list(itt)) | ||
assert list(itt) == [1, 3, 6, 10] | ||
Points = collections.namedtuple("Point", ["x", "y"]) | ||
def fname(a: Dict[int, List], b: Tuple[int], c: Optional[List]): | ||
pass | ||
z = os.getcwd() | ||
end = time.time() | ||
print(end - start) | ||
""" |