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
Please sign in to leave a comment.
Hi Stefan. Do you have tests in this file?
Yes. Here is a video of this odd behaviour: http://gfycat.com/KindDaringHedgehog
Looks like bug. Please report this bug issue tracker https://youtrack.jetbrains.com/
I have the same issue in the most recent PyCharm version (2018.2).
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).
https://intellij-support.jetbrains.com/hc/en-us/community/posts/207739289/comments/360000342020
solved my problem
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