0

I'm trying to write unit tests for a file that use ConfigParser to read in a properties but for some reason it's pulling in an outdated file that's no longer on my filesystem (at least that I can find). This was introduced when I pulled in a git change from a coworker. My local file updated but ConfigParser is still pulling in the non-updated file.

I've tried searching for any cached files in the directory

$ find . -name *.properties

Is there any sort of cache that I may be missing? I've deleted .cache/, tests/__pycache__/, and all compiled .pyc files.

I'm using virtualenv for my testing but I'm seeing this issue even when I recreate the virtual env.

The offending code snippet:

config = ConfigParser.RawConfigParser()
config.read('config.properties')

Any help would be greatly appreciated!

Edit: Added code snippet

  • Interestingly, when I add the parent directory `src/` in front of the filename (`config.read('src/config.properties')`) it works fine even though the file doing the reading and the properties file are in the same directory. Plus this was working fine before this latest commit. Any clue what may be going on? – Adam Scharf Mar 27 '17 at 20:11

1 Answers1

0

I finally found it!

I was seeing the issue while running the unit tests. As I poked around more, I found a helper method that was dynamically creating the properties file in question. This helper method never got updated with the newest properties.