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

1
8 comments

Hi Stefan. Do you have tests in this file? 

0
Avatar
Permanently deleted user

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

0

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

 

0

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

0

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).

8

You may accidentally set certain file name pattern as Auto-detected by content. Check for Preferences > Editor > File Types > Auto-Detect file type by content

 

0

Please sign in to leave a comment.