Skip to content

Commit e048abf

Browse files
committed
🎨 Fix setenv encoding issues with py2 + unicode_literals
This warning was introduced in pytest 3.8.2. For more information, see the pull request at pytest-dev/pytest#4056.
1 parent 4314d2a commit e048abf

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

tests/test_cli.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Test for tmuxp command line interface."""
3-
43
from __future__ import absolute_import
54

65
import json
@@ -116,13 +115,13 @@ def projectdir(homedir):
116115

117116

118117
def test_tmuxp_configdir_env_var(tmpdir, monkeypatch):
119-
monkeypatch.setenv('TMUXP_CONFIGDIR', tmpdir)
118+
monkeypatch.setenv('TMUXP_CONFIGDIR', str(tmpdir))
120119

121120
assert get_config_dir() == tmpdir
122121

123122

124123
def test_resolve_dot(tmpdir, homedir, configdir, projectdir, monkeypatch):
125-
monkeypatch.setenv('HOME', homedir)
124+
monkeypatch.setenv('HOME', str(homedir))
126125
projectdir.join('.tmuxp.yaml').ensure()
127126
user_config_name = 'myconfig'
128127
user_config = configdir.join('%s.yaml' % user_config_name).ensure()
@@ -226,7 +225,7 @@ def test_scan_config_arg(homedir, configdir, projectdir, monkeypatch):
226225
def config_cmd(config):
227226
click.echo(config)
228227

229-
monkeypatch.setenv('HOME', homedir)
228+
monkeypatch.setenv('HOME', str(homedir))
230229
projectdir.join('.tmuxp.yaml').ensure()
231230
user_config_name = 'myconfig'
232231
user_config = configdir.join('%s.yaml' % user_config_name).ensure()

tests/test_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def test_replaces_env_variables(monkeypatch):
356356

357357
sconfig = load_yaml(yaml_config)
358358

359-
monkeypatch.setenv(env_key, env_val)
359+
monkeypatch.setenv(str(env_key), str(env_val))
360360
sconfig = config.expand(sconfig)
361361
assert "%s/test" % env_val == sconfig['start_directory']
362362
assert "%s/test2" % env_val in sconfig['shell_command_before']

tests/test_workspacebuilder.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ def test_global_options(session):
219219

220220
def test_global_session_env_options(session, monkeypatch):
221221
visual_silence = 'on'
222-
monkeypatch.setenv('VISUAL_SILENCE', visual_silence)
222+
monkeypatch.setenv(str('VISUAL_SILENCE'), str(visual_silence))
223223
repeat_time = 738
224-
monkeypatch.setenv('REPEAT_TIME', repeat_time)
224+
monkeypatch.setenv(str('REPEAT_TIME'), str(repeat_time))
225225
main_pane_height = 8
226-
monkeypatch.setenv('MAIN_PANE_HEIGHT', main_pane_height)
226+
monkeypatch.setenv(str('MAIN_PANE_HEIGHT'), str(main_pane_height))
227227

228228
yaml_config = loadfixture("workspacebuilder/env_var_options.yaml")
229229
s = session

0 commit comments

Comments
 (0)