Skip to content

Commit

Permalink
test_compare: add config_tmpdir fixture to block ignore-branches
Browse files Browse the repository at this point in the history
Isolate test_compare() from the environment's west config. This makes
the test pass again when the user sets `west config --global
ignore-branches True`. It was failing like this:

```
  # By default, a checked-out branch should print output, even if
  # the tree is otherwise clean...
  check_output(['git', 'checkout', '-b', 'mybranch'], cwd=kconfiglib)
  actual = cmd('compare')
>    assert actual.startswith('=== Kconfiglib (subdir/Kconfiglib):')
E    AssertionError: assert False
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb authored and mbolivar-nordic committed May 10, 2023
1 parent 28809c6 commit 421d122
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_manifest_freeze(west_update_tmpdir):
assert re.match(eline_re, aline) is not None, (aline, eline_re)


def test_compare(west_init_tmpdir):
def test_compare(config_tmpdir, west_init_tmpdir):
# 'west compare' with no projects cloned should still work,
# and not print anything.
assert cmd('compare') == ''
Expand Down

0 comments on commit 421d122

Please sign in to comment.