Experiments and simulations both suggest that the pressure experienced by an adsorbed phase confined within a carbon nanoporous material can be several orders of magnitude larger than the bulk phase pressure in equilibrium with the system. To investigate this pressure enhancement, we report a molecular-simulation study of the pressure tensor of argon confined in slit-shaped nanopores with walls of various models, including carbon and silica materials. We show that the pressure is strongly enhanced by confinement, arising from the effect of strongly attractive wall forces; confinement within purely repulsive walls does not lead to such enhanced pressures. Simulations with both the Lennard-Jones and Barker-Fisher-Watts intermolecular potentials for argon-argon interactions give rise to similar results. We also show that an increase in the wall roughness significantly decreases the in-pore pressure due to its influence on the structure of the adsorbate. Finally, we demonstrate that the pressures calculated from the mechanical (direct pressure tensor calculations) and the thermodynamic (volume perturbation method) routes yield almost identical results, suggesting that both methods can be used to calculate the local pressure tensor components in the case of these planar geometries.