Skip to content

Commit

Permalink
test_dumb_init: fix syntax warning about 'is'
Browse files Browse the repository at this point in the history
Use == instead of 'is'.

Fixes:

=============================== warnings summary ===============================
tests/test_dumb_init.py:29
  /home/runner/work/extsdk-container/extsdk-container/tests/test_dumb_init.py:29: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if url is "":

tests/test_dumb_init.py:34
  /home/runner/work/extsdk-container/extsdk-container/tests/test_dumb_init.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if workdir is "":

tests/test_dumb_init.py:39
  /home/runner/work/extsdk-container/extsdk-container/tests/test_dumb_init.py:39: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if name is "":

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== 7 passed, 3 warnings in 1.35s =========================

Signed-off-by: Tim Orling <[email protected]>
  • Loading branch information
moto-timo committed Oct 29, 2022
1 parent af92265 commit 5a78815
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_dumb_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ def remove_container(name):

def run_container(testimage, hostdir, name="", workdir="/workdir", url=""):
print("{}, {}, {}, {}".format(testimage, hostdir, workdir, url))
if url is "":
if url == "":
urlarg = ""
else:
urlarg = "--url {}".format(url)

if workdir is "":
if workdir == "":
workdirarg = ""
else:
workdirarg = "--workdir {}".format(workdir)

if name is "":
if name == "":
namearg = ""
else:
namearg = "--name {}".format(name)
Expand Down

0 comments on commit 5a78815

Please sign in to comment.