I have a testing file in /dev/shm/testing.ini and a dev file in /etc.
If I create two paster applications and trigger my tests, the **settings used in main method is getting overwritten by the 2nd one i.e. the dev one. How to overcome this?
They aren't overwriting each other - the main function is just called twice, each time with the settings from the respective ini file. If you want your testing.ini file to inherit some settings from the dev.ini file then you need to look at the include syntax supported by pastedeploy, but I'd recommend just defining each file separately and using the correct one at the appropriate time instead of setting up an inheritance hierarchy of settings.
How to read 2 different ini files via paster get_app function in pyramid?