Skip to content

Commit 3160b95

Browse files
Copilotnjzjz
andcommitted
Remove unused context imports from test files - all Ruff errors fixed
Co-authored-by: njzjz <[email protected]>
1 parent 8175f7e commit 3160b95

15 files changed

+15
-105
lines changed

tests/exploration/test_exploration_scheduler.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
import numpy as np
44

5-
try:
6-
from exploration.context import (
7-
dpgen2,
8-
)
9-
except ModuleNotFoundError:
10-
# case of upload everything to argo, no context needed
11-
pass
5+
# case of upload everything to argo, no context needed
126
from dflow.python import (
137
FatalError,
148
)

tests/exploration/test_lmp_templ_task_group.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
)
88

99

10-
try:
11-
from exploration.context import (
12-
dpgen2,
13-
)
14-
except ModuleNotFoundError:
15-
# case of upload everything to argo, no context needed
16-
pass
10+
# case of upload everything to argo, no context needed
1711

1812
from dpgen2.constants import (
1913
lmp_conf_name,

tests/exploration/test_make_task_group_from_config.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
)
66

77

8-
try:
9-
from exploration.context import (
10-
dpgen2,
11-
)
12-
except ModuleNotFoundError:
13-
# case of upload everything to argo, no context needed
14-
pass
8+
# case of upload everything to argo, no context needed
159
from dpgen2.exploration.task import (
1610
CalyTaskGroup,
1711
LmpTemplateTaskGroup,

tests/mocked_ops.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@
2020
Tuple,
2121
)
2222

23-
try:
24-
from flow.context import (
25-
dpgen2,
26-
)
27-
except ModuleNotFoundError:
28-
# case of upload everything to argo, no context needed
29-
pass
23+
# case of upload everything to argo, no context needed
3024
from dpgen2.constants import (
3125
fp_task_pattern,
3226
lmp_conf_name,

tests/test_block_cl.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@
1313
upload_artifact,
1414
)
1515

16-
try:
17-
from context import (
18-
dpgen2,
19-
)
20-
except ModuleNotFoundError:
21-
# case of upload everything to argo, no context needed
22-
pass
16+
# case of upload everything to argo, no context needed
2317
from context import (
2418
default_host,
2519
default_image,

tests/test_caly_evo_step.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@
2323
calypso_run_opt_file,
2424
)
2525

26-
try:
27-
from context import (
28-
dpgen2,
29-
)
30-
except ModuleNotFoundError:
31-
# case of upload everything to argo, no context needed
32-
pass
26+
# case of upload everything to argo, no context needed
3327
from context import (
3428
default_host,
3529
default_image,

tests/test_collect_data.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
PythonOPTemplate,
1717
)
1818

19-
try:
20-
from context import (
21-
dpgen2,
22-
)
23-
except ModuleNotFoundError:
24-
# case of upload everything to argo, no context needed
25-
pass
19+
# case of upload everything to argo, no context needed
2620
from context import (
2721
default_host,
2822
default_image,

tests/test_dpgen_loop.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@
1313
upload_artifact,
1414
)
1515

16-
try:
17-
from context import (
18-
dpgen2,
19-
)
20-
except ModuleNotFoundError:
21-
# case of upload everything to argo, no context needed
22-
pass
16+
# case of upload everything to argo, no context needed
2317
from context import (
2418
default_image,
2519
skip_ut_with_dflow,

tests/test_merge_caly_evo_step.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@
2424
calypso_run_opt_file,
2525
)
2626

27-
try:
28-
from context import (
29-
dpgen2,
30-
)
31-
except ModuleNotFoundError:
32-
# case of upload everything to argo, no context needed
33-
pass
27+
# case of upload everything to argo, no context needed
3428
from context import (
3529
default_host,
3630
default_image,

tests/test_prep_run_caly.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@
1717
calypso_run_opt_file,
1818
)
1919

20-
try:
21-
from context import (
22-
dpgen2,
23-
)
24-
except ModuleNotFoundError:
25-
# case of upload everything to argo, no context needed
26-
pass
20+
# case of upload everything to argo, no context needed
2721
from context import (
2822
default_host,
2923
default_image,

0 commit comments

Comments
 (0)