Skip to content

Conversation

@leslitagordita
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Aug 3, 2021

@Sachin-Suresh
Copy link
Contributor

Sachin-Suresh commented Aug 25, 2021

@JohnPaulMueller, this is wrt to the Jupyter guide's PyTest Example.

UPDATE: As discussed, have installed all the plugins - ipytestand pytest.

I followed the steps in your guide, and when I executed the main.py file under the Python PyTest Example section, I get the below error. Could you please help on this:

File "main.py", line 5
    %%run_pytest[clean]
    ^
SyntaxError: invalid syntax

@Sachin-Suresh
Copy link
Contributor

Ok, so here is the issue that I am facing.

First of all, when I execute the below command: (tried even with sudo)

conda install -c conda-forge ipytest

I get the error:

  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Collecting package metadata (current_repodata.json): failed

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/sach7411/.conda/pkgs/urls.txt
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/sach7411/.conda/pkgs/urls.txt

In general, it's not advisable to use 'sudo conda'.

Below are the versions I have currently:
Python 3.8.5

pytest 6.1.1 (output from conda list pytest)

And wrt to the Jupyter notebook which I am trying to run following this guide:

When I navigate to the URL shown in the command, I get "This site can’t be reached" in the browser.

Not sure, where I am going wrong. But for now, I am trying to see a workaround for this issue.

And, yes, here is my current main.py file corrected:

# In[1]:
import pytest
import ipytest
ipytest.autoconfig()

# In[2]:
%%run_pytest[clean] -qq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants