File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 99- :issue: `303 ` Add ``common.get_libtmux_version `` which gives the tmux
1010 version as a loose constraint. Fix linking to terms inside docs, and
1111 duplicate description of module which sphinx warned about in api.rst.
12+ - :issue: `266 ` Fix issue on local tests where env variables would cause
13+ show-environment to pause tests indefinitely.
1214- *Insert changes/features/fixes for next release here *
1315
1416libtmux 0.8.4 (2020-10-25)
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22
33import logging
4+ import os
45
56import pytest
67
1112logger = logging .getLogger (__name__ )
1213
1314
15+ @pytest .fixture (autouse = True )
16+ def clear_env (monkeypatch ):
17+ """Clear out any unnecessary environment variables that could interrupt tests.
18+
19+ tmux show-environment tests were being interrupted due to a lot of crazy env vars.
20+ """
21+ for k , v in os .environ .items ():
22+ if not any (
23+ needle in k .lower ()
24+ for needle in [
25+ 'window' ,
26+ 'tmux' ,
27+ 'pane' ,
28+ 'session' ,
29+ 'pytest' ,
30+ 'path' ,
31+ 'pwd' ,
32+ 'shell' ,
33+ 'home' ,
34+ 'xdg' ,
35+ 'disable_auto_title' ,
36+ 'lang' ,
37+ 'term' ,
38+ ]
39+ ):
40+ monkeypatch .delenv (k )
41+
42+
1443@pytest .fixture (scope = 'function' )
15- def server (request ):
44+ def server (request , monkeypatch ):
45+
1646 t = Server ()
1747 t .socket_name = 'tmuxp_test%s' % next (namer )
1848
You can’t perform that action at this time.
0 commit comments