test_models.py not recognized as a python file

Answered

If i create a file named "test_models.py" its will not be recognized. It appears with the Plain Text icon and syntax highlight.

Anyone else with this problem?

Version: PyCharm 2016.2.1

6 comments
Comment actions Permalink

Hi Stefan. Do you have tests in this file? 

0
Comment actions Permalink

Yes. Here is a video of this odd behaviour: http://gfycat.com/KindDaringHedgehog 

0
Comment actions Permalink

Looks like bug. Please report this bug issue tracker https://youtrack.jetbrains.com/

 

0
Comment actions Permalink

I have the same issue in the most recent PyCharm version (2018.2).

0
Comment actions Permalink

I had this issue and resolved it as follows:

Settings->Editor->File Types->Text remove the offending file's name from the list.

I got into this situation when creating a new python file and accidentally creating it as a text file with a .py extension. It then gets added to the configured list of files to be recognized as text (and this is very well hidden if you did realize what you have done).

2

Please sign in to leave a comment.