File tree 5 files changed +13
-13
lines changed
5 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ def setUp(self) -> None:
32
32
shutil .rmtree (workspace_path )
33
33
34
34
# Reset this to avoid the error of it being created twice.
35
- # In real usage, the second run would be a different Python process so DBGymWorkspace.num_times_created_this_run would be 0.
36
- DBGymWorkspace .num_times_created_this_run = 0
35
+ # In real usage, the second run would be a different Python process so DBGymWorkspace._num_times_created_this_run would be 0.
36
+ DBGymWorkspace ._num_times_created_this_run = 0
37
37
self .workspace = DBGymWorkspace (workspace_path )
38
38
39
39
def tearDown (self ) -> None :
Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ def setUp(self) -> None:
24
24
shutil .rmtree (workspace_path )
25
25
26
26
# Reset this to avoid the error of it being created twice.
27
- # In real usage, the second run would be a different Python process so DBGymWorkspace.num_times_created_this_run would be 0.
28
- DBGymWorkspace .num_times_created_this_run = 0
27
+ # In real usage, the second run would be a different Python process so DBGymWorkspace._num_times_created_this_run would be 0.
28
+ DBGymWorkspace ._num_times_created_this_run = 0
29
29
self .workspace = DBGymWorkspace (workspace_path )
30
30
31
31
def tearDown (self ) -> None :
@@ -44,10 +44,10 @@ def test_postgres_dbdata(self) -> None:
44
44
# Make sure to recreate self.workspace so that each function call counts as its own run.
45
45
scale_factor = 0.01
46
46
_postgres_build (self .workspace , False )
47
- DBGymWorkspace .num_times_created_this_run = 0
47
+ DBGymWorkspace ._num_times_created_this_run = 0
48
48
self .workspace = DBGymWorkspace (self .workspace .dbgym_workspace_path )
49
49
_tpch_tables (self .workspace , scale_factor )
50
- DBGymWorkspace .num_times_created_this_run = 0
50
+ DBGymWorkspace ._num_times_created_this_run = 0
51
51
self .workspace = DBGymWorkspace (self .workspace .dbgym_workspace_path )
52
52
53
53
# Test
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def set_up_workspace() -> None:
70
70
# However, it also can't be created more than once so we need to check `is None`.
71
71
if GymlibIntegtestManager .DBGYM_WORKSPACE is None :
72
72
# Reset this in case it had been created by a test *not* using GymlibIntegtestManager.set_up_workspace().
73
- DBGymWorkspace .num_times_created_this_run = 0
73
+ DBGymWorkspace ._num_times_created_this_run = 0
74
74
GymlibIntegtestManager .DBGYM_WORKSPACE = DBGymWorkspace (workspace_path )
75
75
76
76
@staticmethod
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ def tearDown(self) -> None:
40
40
# Importantly though, I don't have helper functions for the complex functions that I want to test (e.g. link_result and save_file).
41
41
def init_workspace_helper (self ) -> None :
42
42
# Reset this to avoid the error of it being created twice.
43
- # In real usage, the second run would be a different Python process so DBGymWorkspace.num_times_created_this_run would be 0.
44
- DBGymWorkspace .num_times_created_this_run = 0
43
+ # In real usage, the second run would be a different Python process so DBGymWorkspace._num_times_created_this_run would be 0.
44
+ DBGymWorkspace ._num_times_created_this_run = 0
45
45
self .workspace = DBGymWorkspace (self .workspace_path )
46
46
47
47
if self .expected_structure is None :
Original file line number Diff line number Diff line change @@ -96,15 +96,15 @@ class DBGymWorkspace:
96
96
Global configurations that apply to all parts of DB-Gym
97
97
"""
98
98
99
- num_times_created_this_run : int = 0
99
+ _num_times_created_this_run : int = 0
100
100
101
101
def __init__ (self , dbgym_workspace_path : Path ):
102
102
# The logic around dbgym_tmp_path assumes that DBGymWorkspace is only constructed once.
103
103
# This is because DBGymWorkspace creates a new run_*/ dir when it's initialized.
104
- DBGymWorkspace .num_times_created_this_run += 1
104
+ DBGymWorkspace ._num_times_created_this_run += 1
105
105
assert (
106
- DBGymWorkspace .num_times_created_this_run == 1
107
- ), f"DBGymWorkspace has been created { DBGymWorkspace .num_times_created_this_run } times. It should only be created once per run."
106
+ DBGymWorkspace ._num_times_created_this_run == 1
107
+ ), f"DBGymWorkspace has been created { DBGymWorkspace ._num_times_created_this_run } times. It should only be created once per run."
108
108
109
109
self .base_dbgym_repo_path = get_base_dbgym_repo_path ()
110
110
self .cur_path_list : list [str ] = ["dbgym" ]
You can’t perform that action at this time.
0 commit comments