File tree Expand file tree Collapse file tree 3 files changed +32
-25
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +32
-25
lines changed
Original file line number Diff line number Diff line change @@ -211,3 +211,24 @@ def ipython_in_subprocess(requested_backend_or_gui_framework, all_expected_backe
211
211
)
212
212
213
213
assert proc .stdout .strip ().endswith (f"'{ expected_backend } '" )
214
+
215
+
216
+ def is_ci_environment ():
217
+ # Common CI variables
218
+ ci_environment_variables = [
219
+ 'CI' , # Generic CI environment variable
220
+ 'CONTINUOUS_INTEGRATION' , # Generic CI environment variable
221
+ 'TRAVIS' , # Travis CI
222
+ 'CIRCLECI' , # CircleCI
223
+ 'JENKINS' , # Jenkins
224
+ 'GITLAB_CI' , # GitLab CI
225
+ 'GITHUB_ACTIONS' , # GitHub Actions
226
+ 'TEAMCITY_VERSION' # TeamCity
227
+ # Add other CI environment variables as needed
228
+ ]
229
+
230
+ for env_var in ci_environment_variables :
231
+ if os .getenv (env_var ):
232
+ return True
233
+
234
+ return False
Original file line number Diff line number Diff line change 19
19
import matplotlib as mpl
20
20
from matplotlib import _c_internal_utils
21
21
from matplotlib .backend_tools import ToolToggleBase
22
- from matplotlib .testing import subprocess_run_helper as _run_helper
22
+ from matplotlib .testing import subprocess_run_helper as _run_helper , is_ci_environment
23
23
24
24
25
25
class _WaitForStringPopen (subprocess .Popen ):
@@ -110,27 +110,6 @@ def _get_testable_interactive_backends():
110
110
for env , marks in _get_available_interactive_backends ()]
111
111
112
112
113
- def is_ci_environment ():
114
- # Common CI variables
115
- ci_environment_variables = [
116
- 'CI' , # Generic CI environment variable
117
- 'CONTINUOUS_INTEGRATION' , # Generic CI environment variable
118
- 'TRAVIS' , # Travis CI
119
- 'CIRCLECI' , # CircleCI
120
- 'JENKINS' , # Jenkins
121
- 'GITLAB_CI' , # GitLab CI
122
- 'GITHUB_ACTIONS' , # GitHub Actions
123
- 'TEAMCITY_VERSION' # TeamCity
124
- # Add other CI environment variables as needed
125
- ]
126
-
127
- for env_var in ci_environment_variables :
128
- if os .getenv (env_var ):
129
- return True
130
-
131
- return False
132
-
133
-
134
113
# Reasonable safe values for slower CI/Remote and local architectures.
135
114
_test_timeout = 120 if is_ci_environment () else 20
136
115
Original file line number Diff line number Diff line change 8
8
9
9
import matplotlib as mpl
10
10
from matplotlib import cm
11
- from matplotlib .testing import subprocess_run_helper
11
+ from matplotlib .testing import subprocess_run_helper , is_ci_environment
12
12
from matplotlib .testing .decorators import check_figures_equal
13
13
from matplotlib .dates import rrulewrapper
14
14
from matplotlib .lines import VertexSelector
@@ -311,7 +311,14 @@ def test_cycler():
311
311
312
312
# Run under an interactive backend to test that we don't try to pickle the
313
313
# (interactive and non-picklable) canvas.
314
- @pytest .mark .backend ('tkagg' )
315
- def test_axeswidget_interactive ():
314
+ def _test_axeswidget_interactive ():
316
315
ax = plt .figure ().add_subplot ()
317
316
pickle .dumps (mpl .widgets .Button (ax , "button" ))
317
+
318
+
319
+ def test_axeswidget_interactive ():
320
+ subprocess_run_helper (
321
+ _test_axeswidget_interactive ,
322
+ timeout = 120 if is_ci_environment () else 20 ,
323
+ extra_env = {'MPLBACKEND' : 'tkagg' }
324
+ )
You can’t perform that action at this time.
0 commit comments