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