Skip to content

Commit

Permalink
may be last try to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoTian committed Aug 18, 2016
1 parent dec0fc5 commit ba490cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ tmpfile.rc
.coverage*
*.bz2
tempfile.rc
*.ipynb
7 changes: 3 additions & 4 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def run_command(command, prefix, *arguments):
prefix = escape_for_winpath(prefix)
arguments = list(map(escape_for_winpath, arguments))
if command is Commands.CONFIG:
command_line = "{0} --file {1} {2}".format(command, join(prefix, 'condarc'), " ".join(arguments))
command_line = "{0} --file {1} {2}".format(command, join(prefix, '', 'condarc'), " ".join(arguments))
elif command is Commands.SEARCH:
command_line = "{0} {1}".format(command, " ".join(arguments))
elif command is Commands.LIST:
Expand All @@ -105,20 +105,19 @@ def run_command(command, prefix, *arguments):
def make_temp_env(*packages, **kwargs):
prefix = kwargs.pop('prefix', None) or make_temp_prefix()
assert isdir(prefix), prefix
prefix = escape_for_winpath(prefix)
with stderr_log_level(DEBUG, 'conda'), stderr_log_level(DEBUG, 'requests'):
with disable_logger('fetch'), disable_logger('dotupdate'):
try:
# try to clear any config that's been set by other tests
reset_context([join(prefix, 'condarc')])
reset_context([join(prefix, '', 'condarc')])
run_command(Commands.CREATE, prefix, *packages)
yield prefix
finally:
rmtree(prefix, ignore_errors=True)


def reload_config(prefix):
prefix_condarc = join(prefix, 'condarc')
prefix_condarc = join(prefix, '', 'condarc')
reset_context([prefix_condarc])


Expand Down
2 changes: 1 addition & 1 deletion tests/test_priority.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_channel_priority_update(self):
assert_package_is_installed(prefix, 'python')

# add conda-forge channel
o,e = run_command(Commands.CONFIG, prefix, "--prepend channels conda-forge", '--json')
o, e = run_command(Commands.CONFIG, prefix, "--prepend channels conda-forge", '--json')
assert context.channels == ("conda-forge", "defaults"), o+e

# update python
Expand Down

0 comments on commit ba490cf

Please sign in to comment.