Cannot run pytest in windows

hi,
New to using exercism on windows. (Getting daughter into python she is on windows). Instructions seem to be powershell only, but i can only get the pytest and submit command to reun in a cmd window.

in VScode shell, that is ‘PS’ I presume powershell, but I get this error 'PS C:\Users\person\Exercism\python\hello-world> py -m pytest -o markers=task {hello_world_test.py}
py.exe : A value that is not valid (markers=task) was specified for the outputFormat parameter. Valid values are Text and Xml.
At line:1 char:1

  • py -m pytest -o markers=task {hello_world_test.py}
  •   + CategoryInfo          : InvalidArgument: (:) [], ParameterBindingException'
    
    

hav looked through stack overflow, and guidelines on exercism, not really sure what I did wrong. Do you mainly use cmd or PS?

Hi @Cranb3rryJu1ce :wave:

Welcome to the Exercism forums! Thanks for posting this.

Both cmd and ps should work on windows, but I think you may have misunderstood the directions. I think the {} around hello_world_test.py shouldn’t be there.

Could you try

C:\Users\person\Exercism\python\hello-world> py -m pytest -o markers=task hello_world_test.py

And see if that works? The {} in the instructions are meant to denote a placeholder where you replace everything (including the brackets) with the values from your machine. So, for example, on my machine:

C:\Users\bethanygarcia\Exercism\python\hello-world> py -m pytest -o markers=task hello_world_test.py

We’ve been meaning to replace those {} with <> which is more “standard” for placeholder values.

It will take me a minute to fire up my Windows VM to double check, but at first glance, I think the {} are the source of your misery.

I had this same conversation on discord get-help before with a new learner, they also thought the {} was required
If you want I can give a try and submit a PR to fix it?

That would be awesome, @glaxxie! I’d love a PR on the doc, and a correction to any errors you find. :smile: Thank you.

It’s done.

Also I saw your conversation on discord about potentially switching to pytest for everything eventually, whenever that happen please let me know so I can learn and help contribute. :smile:

1 Like

Apologies for the delay. :slightly_smiling_face: I’ve reviewed and made suggestions on your PR. Thanks for submitting it!

I will certainly let you know. :smile: But I also want to set expectations: I am in the middle of bug fixing and upgrade work, which will take a bit of time. I then have work to flesh out the Syllabus a bit further in anticipation of the bootcamp students wanting to practice.

Because changing to Pytest-only will mean a major refactor of the test runner in addition to a re-write of the generator and test templates (and a huge amount of testing), it might not get done until the latter half of next year - if at all. Still thinking through what would be best/easiest/most pythonic. :grimacing:

but I will let you know. :smile:

2 Likes

PR approved and merged! :tada:

Thanks again, @glaxxie!

1 Like

Heads-up: Although this thread implies that <...> brackets are now used, I still got the {...} brackets when I downloaded Alphametics. Perhaps this change was somehow accidentally reverted?

I’ve made a new PR here Change curly brackets to angled in tests.md by VaiaPatta1985 · Pull Request #4189 · exercism/python · GitHub, @BethanyG can you review?

@VaiaPatta1985,

Thanks for reporting this! We successfully changed the website files but forgot to change the doc that’s downloaded when working locally. :woman_facepalming:

The Python repos are closed to community contribution unless a maintainer asks for work/a PR here on the forum (after a discussion).

I have reopened the PR and will review it, but will not do that for PRs from you in the future without discussion here on the forum first.

Thanks for you understanding. :slightly_smiling_face:

I see. Apologies for getting ahead of myself there. Next time I notice something, I’ll flag it here on the forums and wait for a maintainer’s response.

I do hope that the PR was helpful after all, though :slight_smile:

It was helpful! Thank you. It has been approved and merged. :smile:

2 Likes